package com.rmuti.programming.callc;

import java.lang.reflect.Field;

public class CallCModule {
	
	static {
		try {
			String libpath = System.getProperty("java.library.path");
			System.out.println("lib path 1 "+libpath);
			libpath = libpath+";C:\\eclipse\\clab-plugin-dev\\eclipse\\clab";
			System.setProperty("java.library.path", libpath);
			
		    final Field sysPathsField = ClassLoader.class.getDeclaredField("sys_paths");
		    sysPathsField.setAccessible(true);
		    sysPathsField.set(null, null);
		    
			System.loadLibrary("student");

		} catch (UnsatisfiedLinkError | IllegalArgumentException | IllegalAccessException | NoSuchFieldException | SecurityException e) {
			e.printStackTrace();
		}
	}
	
	public static native boolean isCModule();
	
	public static native String callCModule(String inputData);
	
	public static void main(String[] args) {
		System.out.println(CallCModule.callCModule("1 3"));
	}
	
}
